<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;
            padding:0;
            list-style:none
        }
       ul li{
           height:200px;
           width: 500px;
           border:1px solid red;
           margin:0 auto;

       }
    </style>
</head>
<body>
    <div id="app">
        <ul>
            <li v-show="i=== activeIndex" v-for="(item,i) in imgList" :style="{background:item}"></li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data(){
                return{
                    activeIndex:0,
                    imgList:["red","blue","pink"]

                }
            },
            methods:{

            },
            mounted(){
                setInterval(() => {
                    if(++this.activeIndex===this.imgList.length){
                        this.activeIndex =0
                    }
                    
                }, 1000);
                

            },
            created:{

            }

        })
    </script>
</body>
</html>